{template 'header'}
<body>
<div class="x-body">
    <form class="layui-form">
        <div class="layui-form-item">
            <label for="project_introduce" class="layui-form-label">
                <span class="x-red"></span>项目介绍
            </label>
            <div class="layui-input-block">
                <input type="hidden" id="project_introduce" name="project_introduce"/>
                <script id="project_introduce_editor" type="text/plain" style="width:80%;height:100px;">{php echo htmlspecialchars_decode($setting['project_introduce'])}</script>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red"></span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="about_us" class="layui-form-label">
                <span class="x-red"></span>关于我们
            </label>
            <div class="layui-input-block">
                <input type="hidden" id="about_us" name="about_us"/>
                <script id="about_us_editor" type="text/plain" style="width:80%;height:100px;">{php echo htmlspecialchars_decode($setting['about_us'])}</script>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red"></span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="new_introduce" class="layui-form-label">
                <span class="x-red"></span>新人引导
            </label>
            <div class="layui-input-block">
                <input type="hidden" id="new_introduce" name="new_introduce"/>
                <script id="new_introduce_editor" type="text/plain" style="width:80%;height:100px;">{php echo htmlspecialchars_decode($setting['new_introduce'])}</script>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red"></span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="cooperate" class="layui-form-label">
                <span class="x-red"></span>合作招商
            </label>
            <div class="layui-input-block">
                <input type="hidden" id="cooperate" name="cooperate"/>
                <script id="cooperate_editor" type="text/plain" style="width:80%;height:100px;">{php echo htmlspecialchars_decode($setting['cooperate'])}</script>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red"></span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button class="layui-btn" lay-filter="save" lay-submit="">
                保存
            </button>
        </div>
    </form>
</div>
<script type="text/javascript" src="{MODULE_URL}static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="{MODULE_URL}static/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="{MODULE_URL}static/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    var ue1 = UE.getEditor('project_introduce_editor');
    var ue2 = UE.getEditor('about_us_editor');
    var ue3 = UE.getEditor('new_introduce_editor');
    var ue4 = UE.getEditor('cooperate_editor');
</script>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        //自定义验证规则
        form.verify({});

        //监听提交
        form.on('submit(save)', function (data) {
            var project_introduce = ue1.getContent()
            var about_us = ue2.getContent()
            var new_introduce = ue3.getContent()
            var cooperate = ue4.getContent()
            var form_data = {
                project_introduce,
                about_us,
                new_introduce,
                cooperate
            }
            //发异步，把数据提交给php
            var url = '{php echo $this->createWebUrl("setting",array("op"=>"introduce"))}'
            $.post(url, form_data, function (ret) {
                console.log(ret)
                if (ret.code) {
                    layer.msg(ret.msg, {icon: 1});
                } else {
                    layer.msg(ret.msg, {icon: 0});
                }
            }, 'json')
            return false;
        });

    });
</script>
<script>var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>

</html>